package com.echo.code.spring.springbootdemo.async;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.stream.IntStream;

/**
 * Description
 *
 * @author baiyp
 * @version 1.0.0
 * @date 2019/04/28
 */
public class App {
  public static void main(String[] args) {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    context.register(AsyncConfig.class);
    context.refresh();
    AsyncTaskService service = context.getBean(AsyncTaskService.class);
    IntStream.range(0, 50).forEach(i -> service.print(i));
    context.close();
  }
}
